/*
 ============================================================================
 Name		: SputnikDrawer.h
 Author	  : Den Grigorenko
 Copyright   : Copyright (c) 2008 Den123
 Description : CSputnikDrawer - this custom control allows to display
               satellites on the celestial sphere
 ============================================================================
*/

#ifndef __SPUTNIK_DRAWER_H__
#define __SPUTNIK_DRAWER_H__

#include <coecntrl.h> 
#include <lbssatellite.h> 
#include <gdi.h> 

// FORWARD DECLARATIONS
class CGulIcon;
class SFontData;

class CSputnikDrawer : public CCoeControl
{
   public:
     ~CSputnikDrawer();
     void ConstructL( const CCoeControl* aParent, SFontData* aFontData, TPositionSatelliteInfo* aData, const TDesC& aWaitMess );
     void SetAngle( TInt aAngle );

   private:
     void SizeChanged();
     void Draw( const TRect& aRect ) const;
     void DrawSputnik( CBitmapContext& aGc, TSatelliteData& aSatData, TInt aRadius, TInt anOffs  ) const;
     
     void ConsiderAngle( TReal& aX, TReal& aY, TInt aRadius, TInt anOffs ) const;
     
   private:
     TReal iAngle;
     TBuf<128> iWaitMess;
     CGulIcon *iIconSphere, *iIconGreen, *iIconGray; 
     SFontData* iFontData;
     TPositionSatelliteInfo* iData;

   private:
      // ����������� ������������� �������������� �� iOffScreenBitmap
      TDisplayMode      iMode;
      CFbsBitmap*       iOffScreenBitmap;
      CFbsBitmap*       iRotatedOffscreenBitmap;
      CFbsBitmapDevice* iOffScreenBitmapDevice;
      CFbsBitGc*        iOffScreenBitmapGc;      	   
};

#endif


